import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get_navigation/src/root/get_material_app.dart';
import 'package:mvip_aida/layout/tabbar.dart';
import 'package:mvip_aida/router/appRouter.dart';

void main() {
  runApp(const MyApp());

  if (Platform.isAndroid) {
    // 沉浸式状态栏
    SystemUiOverlayStyle style = SystemUiOverlayStyle(
      statusBarColor: Colors.transparent,
      /// 这是设置状态栏的图标和字体的颜色
      /// Brightness.light  一般都是显示为白色
      /// Brightness.dark 一般都是显示为黑色
      statusBarIconBrightness: Brightness.light,
    );
    SystemChrome.setSystemUIOverlayStyle(style);
  }

}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    // GetMaterialApp 替代 MaterialApp。
    return GetMaterialApp(
      title: 'Flutter Demo',
      // 去除debug
      debugShowCheckedModeBanner: false,
      // 启动页
      initialRoute: AppRouter.splash,
      unknownRoute: AppRouter.unknownRoute,
      // 注册路由
      getPages: AppRouter.routes,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
    );
  }
}




